package com.cbg.score.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.cbg.base.utils.Result;
import com.cbg.score.entity.ScChanal;
import com.cbg.score.mapper.ScChanalMapper;
import com.cbg.score.service.IScChanalService;
import com.cbg.base.core.SuperServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yangkexiong
 * @since 2018-12-22
 */
@Service
public class ScChanalServiceImpl extends SuperServiceImpl<ScChanalMapper, ScChanal> implements IScChanalService {

    //获取渠道信息
    public Result<ScChanal> getChanalInfol(Integer id){
        //通过渠道id获取
        ScChanal scChanal = getOne(new LambdaQueryWrapper<ScChanal>().eq(ScChanal::getId,id));
        if(ObjectUtil.isNull(scChanal)){
            return Result.ok(scChanal);
        }else {
            return Result.fail();
        }
    }
}
